
import { rbacUserAdd, rbacUserDelete, rbacUserUpdate, rbacUserQueryUserByNameLikel, rbacUserAddUserRole, rbacUserQueryRole } from '@/api/userController'

const state = {}
const mutations = {}
const actions = {
  // 新增用户
  async rbacUserAdd(...rest) {
    const result = await rbacUserAdd(rest[1])
    return result
  },
  // 删除用户
  async rbacUserDelete(...rest) {
    const result = await rbacUserDelete(rest[1])
    return result
  },
  // 更新用户
  async rbacUserUpdate(...rest) {
    const result = await rbacUserUpdate(rest[1])
    return result
  },
  // 查询全部用户
  async rbacUserQueryUserByNameLikel(...rest) {
    const result = await rbacUserQueryUserByNameLikel(rest[1])
    return result
  },
  // 绑定用户(id)和角色(id)之间的关系【包括新增更新】
  async rbacUserAddUserRole(...rest) {
    const result = await rbacUserAddUserRole(rest[1])
    return result
  },
  // 根据用户(id)查询关联菜单
  async rbacUserQueryRole(...rest) {
    const result = await rbacUserQueryRole(rest[1])
    return result
  }

}
const getters = {}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
